\chapter{State}

In order to offer the requested functionalities, the OS will have to keep a lot of things in memory. The main of them are:
\begin{description}
	\item[The ready queue:] it will contain all the PCBs of processes ready to execute. The scheduler will then use this queue to select the next process to run.
	\item[Process control blocks:] the OS will have to keep a PCB for each process in memory. A PCB will contain information about its process, such as its priority, its state, its processor context and some others things.
	\item[Processes table:] since the PCBs are not always in the same place, we need to keep information about all the processes of our system in a fixed known place. This is what this table is for. All processes in the system will be present in the table and therefore can be easily accessed to perform some system calls (like get the information of a process).  
	\item[Program table:] since we do not have a filesystem, all the user programs will be referenced into a table. This table will be used to determine the correct entry point when the OS will be asked to run a program.
	\item[Message queues:] each process will have a message queue. Messages sent to that process will then be put in this queue and the receive action will therefore be a look-up of this queue. 
	\item[Supervision:] each process will have a table where its supervisors are registered. This will allow data to be passed from the supervised process to its supervisors at termination.
	\item[I/O queues:] these queues will be associated with I/O devices and will contain processes wanting to use the device. That way, a process will be the only one to use a device until it finishes using it (so, there will be no interleaving of messages on the console, for example). 
\end{description}
